/****
 * Copyright (C) 2006 dNux Team
 *                                                            ****
 * This program is free software; you can redistribute it and/or *
 * modify under the terms of the GNU General Public License as   *
 * published by the Free Software Foundation;                    *
 * either version 2 of the License.                              *
 *                                                               *
 * This program is distributed in the hope that it will be       *
 * useful, but WITHOUT ANY WARRANTY; without even the implied    *
 * warranty of without even the implied waranty of               *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.          *
 * See the GNU General Public License for more details.          *
 *                                                               *
 * You should have received a copy of the                        *
 * GNU General Public License                                    *
 * along with this program; if not, write to the                 *
 * Free Software Foundation, Inc.,                               *
 * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA. *
 *                                                               *
 ****                                                         ****/

#ifndef __DCORE_ERROR_H__
#define __DCORE_ERROR_H__

typedef struct _d_error_s {
  char *where;
  int  line;
  char *file;
  char *message;
} d_error_t;

#define d_error(where, message) *error = d_error_new(where, message, __FILE__, __LINE__);

d_error_t *d_error_new(char *where, char *message, char *file, int line);
void       d_error_free(d_error_t **error);
char      *d_error_get_message(d_error_t *error);
int        d_error_get_line(d_error_t *error);
char      *d_error_get_file(d_error_t *error);
char      *d_error_get_where(d_error_t *error);
void       d_error_display(d_error_t *error);

#endif /* __DCORE_ERROR_H__ */
